
<template>
  <div class="wrapper">
      <swiper :options="swiperOption">
          <swiper-slide v-for='item of list' :key='item.id'>
            <img class='swiper-img' :src="item.imgurl">
          </swiper-slide>
          <div class="swiper-pagination"  slot="pagination"></div>
        </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props: { // 从外部接受数据，将:list='swiperList'中的list数组传过来
    list: Array // 定义为Array数组
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true
      }

    }
  }
}
</script>
<style lang="stylus" scoped>
    .wrapper >>> .swiper-pagination-bullet-active
        background: #fff
    .wrapper
        overflow: hidden
        width: 100%
        heigth: 0
        padding-bottom: 31.25%
        padding: 0
        .swiper-img
            width: 100%
</style>
